<h2><?php __('Course Delivery Engine Management');?></h2>
<?php echo $html->link(__('Manage Media', true), array('action'=>'../cde_multimedias/index')); ?>
<table class="list">
<tr>
	<th><?php echo $paginator->sort('Unit title', 'title');?></th>
	<th><?php echo $paginator->sort('Description', 'description');?></th>
	<th class="checkbox">Enabled</th>
	<th class="actions"><?php __('Actions');?>&nbsp;|&nbsp;<?php echo $html->link(__('Create new unit', true), array('action'=>'add')); ?></th>
</tr>
<?php
$i = 0;
foreach ($cdeUnits as $cdeUnit):
	$class = null;
	if ($i++ % 2 == 1) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $cdeUnit['CdeUnit']['title']; ?>
		</td>
		<td>
			<?php echo $cdeUnit['CdeUnit']['description']; ?>
		</td>
		<td class="checkbox">
			<input type="checkbox" <?php if ($cdeUnit['CdeUnit']['enabled']) echo "checked='checked'"; ?> disabled='disabled' />
		</td>
		<td class="actions">
			<?php echo $html->link(__('Update', true), array('action'=>'edit', $cdeUnit['CdeUnit']['id'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php echo $html->link(__('Delete', true), array('action'=>'delete', $cdeUnit['CdeUnit']['id']), null, sprintf(__('Are you sure you want to delete "%s" unit?', true), $cdeUnit['CdeUnit']['title'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php echo $html->link(__('Manage', true), array('action'=>'manage', $cdeUnit['CdeUnit']['id'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php
				if ($cdeUnit['CdeUnit']['enabled'])
				{
					echo $html->link(__('Disable', true), array('action'=>'disable', $cdeUnit['CdeUnit']['id']));
				}
				else
				{
					echo $html->link(__('Enable', true), array('action'=>'enable', $cdeUnit['CdeUnit']['id']));
				}
			?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
<p><?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> <?php echo $paginator->numbers();?> <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?></p>